<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<s:url value="/css/style.css"/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<s:url value="/js/jquery.js"/>" ></script>
<script type="text/javascript" src="<s:url value="/js/common.js"/>" ></script>
<script type="text/javascript">

function newSub(){
	$('#id').val('');
	$('#parentId').val($('#menuId').val());
	$('#parentName').val($('#menuName').val());
	$('#listForm').submit();
}
function newParent(){
	$('#id').val('');
	$('#parentId').val('');
	$('#parentName').val('');
	$('#listForm').submit();
}
function editCurrent() {
	$('#id').val($('#menuId').val());
	$('#listForm').submit();
}
function responseSelect(id, name, level) {
	$('#menuId').val(id);
	$('#menuName').val(name);
	$('#ec').attr('disabled',false);
	if(level&&level=='1') {
		$('#ns').attr('disabled',false);
	}else {
		$('#ns').attr('disabled',true);
	}
}
function reset() {
	$('#parentId').val('');
	$('#parentName').val('');
	$('#menuName').val('');
	$('#ec').attr('checked',false);
	$('#ns').attr('disabled',true);
	$('#ec').attr('disabled',true);
	$('#ns').attr('checked',false);
	$('#np').attr('checked',false);
}
</script>
<title><s:text name="system.title" /></title>
</head>
<body>
<s:form action="Menu/edit" name="listForm" id="listForm" target="edit" namespace="/system" method="get">
	<s:hidden name="id" id="id"></s:hidden>
	<s:hidden name="parentId" id="parentId"></s:hidden>
	<s:hidden name="parentName" id="parentName"></s:hidden>
</s:form>
<s:include value="/common/up.jsp"></s:include>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="box" width="400px" valign="top">
    <input type="hidden" name="menuId" id="menuId" />
    Current Selected Menu: <input type="text" name="menuName" id="menuName"/><br/>
    <input type="radio" name="1" id="ec" onclick="editCurrent()" disabled /> Edit Current
    <input type="radio" name="1" id="ns" onclick="newSub()" disabled/> New sub in selected menu
     <input type="radio" name="1" id="np" onclick="newParent()"/> New parent menu
     <iframe name="list" id="list" src="<s:url value="/system/Menu/list"/>" height="400px" frameborder="0" width="100%"></iframe>
     
    </td>
    <td class="box">
     <iframe name="edit" id="edit"  frameborder="0"  width="100%" height="400px"></iframe>
    </td>
  </tr>
</table>
<s:include value="/common/down.jsp"></s:include>
</body>
</html>